{% extends "resource.html" %}

{% block title %}DAMN - {{ file.file_name }}{% endblock %}

{% block left.extra %}
  <h2>Uploaded:</h2>
  {{ file.stamp }}
{% endblock %}

{% block right %}

<div class="row">
  <div class="span10">
    <span class="title">File: {{ file.id }} {{ file.file_name }}</span>
  </div>
  <div class="span2">
  </div>
</div>
<div class="row">
  <div class="span5">
    <ul class="media-grid">
    {% for asset in file.asset_set.all %}
      <li>
        {% include "snippets/smallpreview.html" with asset=asset only %}
      </li>
    {% empty %}
      No assets
    {% endfor%}
    </ul>
  </div>
  <div class="span7">
    <div class="block">
      <h1>Version:  {{ file.version }}</h1>
     {% if file.ancestor %}
       Previous revision: <a href="/files/{{ file.ancestor.id }}/"> {{ file.ancestor.file_name }}</a>
     {% endif %}
     {% if not file.is_latest %}
       Next revision: <a href="/files/{{ file.descendant.id }}/"> {{ file.descendant.file_name }}</a>
       <span class="label notice">Newest: <a href="/files/{{ file.latest.id }}/"> {{ file.latest.file_name }}</a><span>
     {% else %}
       <span class="label success">Latest</a><span>
     {% endif %}
    </div>
    <div class="block">
      <h1>Download:</h1>
      <a href="{{ file.location.url }}">Download</a>
    </div>
    <div class="block">
      <h1>Paths:</h1>
      {% for path in file.filepath_set.all %}
        {{ path.file_path }}<br />
      {% empty %}
        No associated paths
      {% endfor%}
    </div>
    <div class="block">
      <h1>Hash:</h1>
      {{ file.hash }}
    </div>
  </div>
</div>
  
  
  <div class="block">
    <h1>Jobs:</h1>
    {% for job in file.jobs.all %}
      {{ job.method }} - {{ job.status }} 
      ( {{ job.start_date|date:"SHORT_DATETIME_FORMAT" }} - {{ job.end_date|date:"SHORT_DATETIME_FORMAT" }} : {{ job.duration }} )<br />
    {% empty %}
      No associated jobs
    {% endfor%}
  </div>


{% endblock %}
